feat(toolchain): jest test-gate auto-detection + multi-ext arch scan for JS/TS (F-47b8bee5)#217
Open
yuyu04 wants to merge 1 commit into
Open
feat(toolchain): jest test-gate auto-detection + multi-ext arch scan for JS/TS (F-47b8bee5)#217yuyu04 wants to merge 1 commit into
yuyu04 wants to merge 1 commit into
Conversation
e16b12d to
d97c167
Compare
…for JS/TS (F-47b8bee5)
React/JS-family projects resolve to language 'typescript' but the toolchain
defaulted the test gate to vitest unconditionally and scanned only .ts in the
arch (madge) gate. Two silent footguns for React/RN/CRA repos:
- Jest projects hit `npx --no-install vitest`, found nothing, and SILENTLY
skipped stage_2.1 (unit) / stage_2.2 (coverage). Now `resolveTsGates`
detects a jest.config.{js,ts,mjs,cjs,json} file or a `jest` key in
package.json (mirroring resolveTsLint's presence-based detection) and gates
with jest / jest --coverage. No jest config → vitest default unchanged.
- madge `--extensions ts` missed .tsx/.jsx/.js, so circular-dependency
detection was blind to React/JSX component trees. Widened to ts,tsx,js,jsx
(node_modules is excluded by madge default, so no dependency-tree blowup).
Tests authored impl-blind in a separate context (11 new cases in
tests/stages/toolchain.test.ts). strict pre-push gate GREEN.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
d97c167 to
c0ef1b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes two silent usability footguns for React / React Native / CRA projects, which all resolve to
language: 'typescript'viapackage.json.1. Jest test-gate auto-detection
The test gate defaulted to vitest unconditionally, so Jest-based projects hit
npx --no-install vitest, found nothing, and silently skippedstage_2.1(unit) +stage_2.2(coverage) — no tests gated at all.resolveTsGatesnow detects the runner the project actually configured (mirrors the existingresolveTsLintbiome/oxlint detection):jest.config.{js,ts,mjs,cjs,json}present, or ajestkey inpackage.json→npx --no-install jest/jest --coverage2. Multi-extension arch scan
madge --extensions tsmissed.tsx/.jsx/.js, so circular-dependency detection was blind to React/JSX component trees. Widened tots,tsx,js,jsx. (node_modulesis excluded by madge default — verified no dependency-tree blowup; 323 files scanned on this repo.)Spec
F-47b8bee5(3 ACs, EARS-compliant), module-bound tosrc/stages/toolchain/detect.ts.Tests
tests/stages/toolchain.test.ts, authored impl-blind in a separate context (per the persona-separation invariant).clad done F-47b8bee5→ strict pre-push gate GREEN (rebased onto develop, re-verified).🤖 Generated with Claude Code